Skip to content

Add option to partially hash files#195

Closed
alexmi256 wants to merge 1 commit intopauldreik:mainfrom
alexmi256:partial_checksums_v2
Closed

Add option to partially hash files#195
alexmi256 wants to merge 1 commit intopauldreik:mainfrom
alexmi256:partial_checksums_v2

Conversation

@alexmi256
Copy link
Copy Markdown

Adds the -partialchecksum option which takes in the number of MB to be hashed from the start and end of the file instead of hashing the whole file.

This option is set to 0 by default which means it is disabled.

When it is set to a value like 1, the first 1mb of the file would be read, the we'd skip head to file_size - 1mb and read that last 1mb to compute the checksum.
This option will only take info effect if file_size > 2 * partial checksum size.

This has the tradeoff of much quicker hashing times (the different hashing algos don't matter much where you're limited by disk speed) at the risk of false positives.

Adds the `-partialchecksum` option which takes in the number
of MB to be hashed from the start and end of the file instead of
hashing the whole file.

This option is set to 0 by default which means it is disabled.

When it is set to a value like 1, the first 1mb of the file would
be read, the we'd skip head to file_size - 1mb and read that last
1mb to compute the checksum.
This option will only take info effect if file_size > 2 * partial
checksum size.

This has the tradeoff of much quicker hashing times (the different
hashing algos don't matter much where you're limited by disk speed)
at the risk of false positives.
@pauldreik
Copy link
Copy Markdown
Owner

Thanks for the PR!
Unfortunately superseded by #208

@pauldreik pauldreik closed this Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants